<script type="text/javascript">
function redirectPageComplete()
{
	alert("ทำรายการติดต่อสำเร็จ ขอบคุณค่ะ");
	location = "../../contacts.php";
}

function redirectPageIncomplete()
{
	alert("เกิดข้อผิดพลาดในการเพิ่มข้อมูล");
	location = "../../contacts.php";
}
<?php 
	$id= $_POST['contacts_id'];
	$to = $_POST['contacts_to'];
	$cc = $_POST['contacts_cc'];
	$bc = $_POST['contacts_bc'];
	$title = $_POST['contacts_subject'];
	$description = $_POST['contacts_description'];
	// ถ้า user submit ฟอร์มมา
	if(isset($id)){
		$headers = "From: myplace@here.com\r\n";
		$headers .= "Reply-To: myplace2@here.com\r\n";
		$headers .= "Return-Path: myplace@here.com\r\n";
		$headers .= "CC: sombodyelse@noplace.com\r\n";
		$headers .= "BCC: hidden@special.com\r\n";
		
		$header = "From: formantailor@gmail.com\r\n";
		$header .= "CC: $cc\r\n";
		$header .= "BCC: $bc\r\n";
		$header .= "Content-type: text/html; charset=utf-8\r\n" ;					

		$subject = '=?utf-8?B?'.base64_encode("formantailor :".$title).'?=';
		$flgSend = mail($to,$subject,$description,$header);  
		if($flgSend)
		{		
			include '../../../inc/reuse/dbconfig.php';
			$sql = "UPDATE contacts
						SET contacts_reply = 0			
						WHERE contacts_id=$id";
			mysql_query($sql);
			echo "redirectPageComplete();";			
		}						
		else 
		{
			echo "redirectPageIncomplete()";
		}
		
		
	} 
	else
	{
		echo "redirectPageIncomplete()";
	}
?>
</script>